<?php
$isset1=$_POST["user"];
$isset2=$_POST["pass"];
$isset3=$_POST["rpass"];
if(!($isset1 and $isset2 and $isset3))  //有个Notice
{  
  echo "<center>";
  echo "您没有输入用户名或者密码、确认密码！\n";
  echo "单击<a href='reg_l.php'>这里</a>重新注册";
  echo "</center>";
}
else if($isset2!=$isset3)
{
	echo "<center>";
	echo "您输的密码不一致！\n";
	echo "单击<a href='reg_l.php'>这里</a>重新注册";
	echo "</center>"; 
}
else
{
	include "config.php";
	$user=$_POST["user"];
	$pass=$_POST["pass"];
	$sql="select * from $test_user where name='$user'";
	$result=$mysqli->query($sql);
	$num=$result->num_rows;
	if($num>0)
	{
		echo "用户名已存在！<p>";
		echo "单击<a href='reg_l.php'>这里</a>重新注册";
	}
	else
	{
		$sql="insert into $test_user (name,pass,admin) values ('$user','$pass',0)";
		$result=$mysqli->query($sql) or die($mysqli->error);
		if($result)
		{
			echo "<center>";
			echo "注册成功！<p>";
			echo "单击 <a href='login_l.php'>这里</a>登录系统";
			echo "</center>";
		}
	}
}
?>